package com.sp.api.springbootapi.dao;

import com.sp.api.springbootapi.model.TGoodsInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface TGoodsInfoMapper {

    int insert(TGoodsInfo record);

    int deleteByPrimaryKey(@Param("code") String code);

    TGoodsInfo selectByPrimaryKey(@Param("code")String code);

    int updateByPrimaryKeySelective(TGoodsInfo record);

    int updateByPrimaryKey(TGoodsInfo record);

    //基于版本号
    int updateAmountByVersion(@Param("code") String code, @Param("buys") Integer buys,@Param("version") Integer version);
    //基于状态
    int updateAmountByState(@Param("code") String code, @Param("buys") Integer buys);

    //没有任何特殊处理
    int updateGoodsAmountWithoutAnyDeal(@Param("code") String code, @Param("buys") Integer buys);

}